require("UIColor,UITableViewCell")
defineClass("ViewController : UIViewController <UIAlertViewDelegate>", {
            
            tableView_cellForRowAtIndexPath: function(tableView, indexPath) {
            var cell = tableView.dequeueReusableCellWithIdentifier_forIndexPath("cell",indexPath);
            cell.textLabel().setText("新增");
            cell.textLabel().setTextColor(UIColor.redColor());
            cell.setBackgroundColor(UIColor.blueColor());
            return cell;
            },
            
            tableView_didSelectRowAtIndexPath: function(tableView, indexPath) {
            var row = indexPath.row();
            var data = self.dataArray().toJS();
            if (data.length <= row) {  // 加上判断越界的逻辑
            var alertView = require('UIAlertView')
            .alloc()
            .initWithTitle_message_delegate_cancelButtonTitle_otherButtonTitles(
                                                                                "擦",
                                                                                "是不是傻，点这个会崩溃的！",
                                                                                self,
                                                                                "我是呆子",
                                                                                null
                                                                                );
            alertView.show();
            }
            },
            alertView_clickedButtonAtIndex: function(alertView, buttonIndex) {
            console.log('clicked index ' + buttonIndex)
            }
            }, {});